/**
 * 
 */
package cn.softTank.BpelModelImpl;

import java.util.ArrayList;
import java.util.List;

import org.dom4j.Element;

import cn.softTank.BpelModel.Assign;
import cn.softTank.BpelModel.Copy;
import cn.softTank.BpelModel.ExtensionAssignOperation;

/**
 * @author Yuzone
 * 
 */
public class AssignImpl extends ActivityImpl implements Assign {

	private List<Copy> copy;

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#addCopy(cn.softTank.BpelModel.Copy)
	 */
	@Override
	public void addCopy(Copy value) {
		if (copy == null) {
			copy = new ArrayList<Copy>();
		}
		copy.add(value);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Assign#addExtensionAssignOperation(cn.softTank.
	 * BpelModel.ExtensionAssignOperation)
	 */
	@Override
	public void addExtensionAssignOperation(ExtensionAssignOperation value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#getCopy()
	 */
	@Override
	public List<Copy> getCopy() {
		return copy;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#getExtensionAssignOperation()
	 */
	@Override
	public List<ExtensionAssignOperation> getExtensionAssignOperation() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#getValidate()
	 */
	@Override
	public Boolean getValidate() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#isSetValidate()
	 */
	@Override
	public boolean isSetValidate() {
		// TODO Auto-generated method stub
		return false;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#removeCopyAt(int)
	 */
	@Override
	public void removeCopyAt(int index) {
		if (copy != null && index < copy.size()) {
			copy.remove(index);
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#removeExtensionAssignOperationAt(int)
	 */
	@Override
	public void removeExtensionAssignOperationAt(int index) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#setCopy(java.util.List)
	 */
	@Override
	public void setCopy(List<Copy> value) {
		copy = value;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Assign#setExtensionAssignOperation(java.util.List)
	 */
	@Override
	public void setExtensionAssignOperation(List<ExtensionAssignOperation> value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#setValidate(java.lang.Boolean)
	 */
	@Override
	public void setValidate(Boolean value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Assign#unsetValidate()
	 */
	@Override
	public void unsetValidate() {
		// TODO Auto-generated method stub

	}

	@Override
	public Element toElement() {
		node = super.toElement();
		node.setName("assign");
		if (copy != null) {
			for (Copy c : copy) {
				node.add(c.toElement());
			}
		}

		return node;
	}
}
